﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using Teigha.Core;

namespace Teigha.TD
{
	public class OdDbRevolveOptions : IDisposable
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdDbRevolveOptions(IntPtr cPtr, bool cMemoryOwn)
		{
			this.swigCMemOwn = cMemoryOwn;
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdDbRevolveOptions obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdDbRevolveOptions()
		{
			this.Dispose();
		}

		public virtual void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							TD_DbPINVOKE.delete_OdDbRevolveOptions(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
		}

		public OdDbRevolveOptions() : this(TD_DbPINVOKE.new_OdDbRevolveOptions__SWIG_0(), true)
		{
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdDbRevolveOptions(OdDbRevolveOptions src) : this(TD_DbPINVOKE.new_OdDbRevolveOptions__SWIG_1(OdDbRevolveOptions.getCPtr(src)), true)
		{
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdDbRevolveOptions Assign(OdDbRevolveOptions src)
		{
			OdDbRevolveOptions result = new OdDbRevolveOptions(TD_DbPINVOKE.OdDbRevolveOptions_Assign(this.swigCPtr, OdDbRevolveOptions.getCPtr(src)), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double draftAngle()
		{
			double result = TD_DbPINVOKE.OdDbRevolveOptions_draftAngle(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setDraftAngle(double ang)
		{
			TD_DbPINVOKE.OdDbRevolveOptions_setDraftAngle(this.swigCPtr, ang);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double twistAngle()
		{
			double result = TD_DbPINVOKE.OdDbRevolveOptions_twistAngle(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setTwistAngle(double ang)
		{
			TD_DbPINVOKE.OdDbRevolveOptions_setTwistAngle(this.swigCPtr, ang);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool closeToAxis()
		{
			bool result = TD_DbPINVOKE.OdDbRevolveOptions_closeToAxis(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setCloseToAxis(bool val)
		{
			TD_DbPINVOKE.OdDbRevolveOptions_setCloseToAxis(this.swigCPtr, val);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdResult checkRevolveCurve(OdDbEntity pRevEnt, OdGePoint3d axisPnt, OdGeVector3d axisDir, out bool closed, out bool endPointsOnAxis, out bool planar, bool displayErrorMessages)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbRevolveOptions_checkRevolveCurve__SWIG_0(this.swigCPtr, OdDbEntity.getCPtr(pRevEnt), OdGePoint3d.getCPtr(axisPnt), OdGeVector3d.getCPtr(axisDir), out closed, out endPointsOnAxis, out planar, displayErrorMessages);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult checkRevolveCurve(OdDbEntity pRevEnt, OdGePoint3d axisPnt, OdGeVector3d axisDir, out bool closed, out bool endPointsOnAxis, out bool planar)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbRevolveOptions_checkRevolveCurve__SWIG_1(this.swigCPtr, OdDbEntity.getCPtr(pRevEnt), OdGePoint3d.getCPtr(axisPnt), OdGeVector3d.getCPtr(axisDir), out closed, out endPointsOnAxis, out planar);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		protected bool swigCMemOwn;
	}
}
